//
//  EssenceComment.swift
//  FM
//
//  Created by x on 2017/10/13.
//  Copyright © 2017年 HLB. All rights reserved.
//

import UIKit

class EssenceComment: NSObject {

    /// 该条评论ID
    var id:String?
    
    /// 该用户id
    var user_id:String?
    
    /// 评论内容
    var content:String?
    
    /// 评论时间
    var created:String?
    
    /// 字符串格式时间
    var created_str:String?
    
    var zannum:String?
    
    var replynum:String?
    
    var role:String?
    
    var role_id:String?
    
    /// 该评论用户
    var user:User?
    
    //var replyuser:String?
    
    /// 回复人信息
    //var reply:[String]?
    
    
    /// 评论楼数
    var floor:Int = 0
    

    init(dic:[String:AnyObject]) {
        super.init()
        setValuesForKeys(dic)
    }
    
    override func setValue(_ value: Any?, forKey key: String) {
        super.setValue(value, forKey: key)
        
        if "user" == key {
            user = User(dic: value as! [String:AnyObject])
            return
        }
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        //print("EssenceComment====key======\(key)")
    }
    
    override var description: String {
        let keys = ["id","user_id","content","created","created_str","zannum","replynum","role","role_id","user","floor"]
        let dic = dictionaryWithValues(forKeys: keys)
        
        return "\(dic)"
    }
}






